SftTree/OCX 7.0

DataObject.GetData Method

Softel vdm, Inc.

Retrieves data of a specified format from a DataObject object.

Syntax       

VB.NET

Data = object.GetData([ ByVal Format As Object ] )  As Object

VB

Data = object.GetData([ ByVal Format As Variant ] )  As Variant

C#.NET

object Data = object.GetData(object Format);

VC++

_variant_t Data = object->GetData(const _variant_t& Format = vtMissing);

C

HRESULT object->raw_GetData(VARIANT Format, VARIANT* Data);

Delphi

Data := object.GetData(Format : OleVariant)   : OleVariant;

object

A DataObject object.

Format

The data format requested (see SftOLEClipboardConstants).  The Format argument is optional.  If Format is not specified, GetData returns data in a suitable format.

Format

Value

Description

sftCFText

1

Text (as a String value)

sftCFBitmap

2

Bitmap (as Picture object)

sftCFMetafile

3

Metafile (as Picture object)

sftCFDIB

8

Device independent bitmap (as Picture object)

sftCFFiles

15

List of files. The GetData method cannot be used to retrieve this format. Use the DataObject.Files collection instead.

sftCFRTF

-16639

Rich text format (as String value)

Data

Returns data of a specified format from a DataObject object.

Comments

The GetData method retrieves data of a specified format from a DataObject object.

It is possible for the GetData method and DataObject.SetData method to use data formats other than those listed as valid Format argument, including user-defined formats registered with Windows via the RegisterClipboardFormat() API function.  The DataObject.SetData method requires the data to be in the form of a byte array when it does not recognize the data format specified.  The GetData method always returns data in a byte array when it is in a format that it doesn't recognize, although this may be transparently converted into other data types, such as strings.  The byte array returned by GetData will be larger than the actual data when running on some operating systems, with arbitrary bytes at the end of the array.  This allocation of memory is often larger than is actually required for the data.  Therefore, there may be extraneous bytes near the end of the allocated memory segment.

See Also  DataObject Object | Object Hierarchy


Feedback / comments / error reports for this topic
© 2015 - Softel vdm, Inc. - www.softelvdm.com